# -*- coding: utf-8 -*-            
# @Author : liguang
# @Time : 2023/11/17 9:29
from time import sleep


# class Liguang:
#
#
#     def __init__(self, name: str):
#         print("init method execute")
#
#     def __new__(cls, *args, **kwargs):
#         print("new method execute")
#         super().__new__( *args, **kwargs)
#
#     def sayHello(self):
#         print(f"你好，我的名字是：")
#
#
# liguang = Liguang()
# liguang.sayHello()


class MyClass:



    """
    类变量   类变量  如果变量名称大写，表示的是常量
    """
    name='guang'

    def __new__(cls, *args, **kwargs):
        print("Executing __new__ method")
        instance = super(MyClass, cls).__new__(cls)
        return instance

    def __init__(self, *args, **kwargs):
        print("Executing __init__ method")
        self.value = args[0]

    # 创建实例


obj = MyClass(5)
print("Object value:", obj.value)
obj1 = MyClass(1)
obj2 = MyClass(2)
print(f"obj1 {obj.name},obj2:{obj1.name},obj3:{obj2.name}")

print(f"myclass.name is {MyClass.name}")